// TOWN DIALOGUE SCRIPT
//    Town 2: War Camp

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;
variables;

int i,j,k,w,x,y,z,lvl,choice;

//**Andrew**

begintalknode 1;
	state = -1;
	question = "Andrew";
	text1 = "This soldier is joking with the other two here. He's doing most of the talking. Over their conversation, you hear that his name is Andrew.";
	text2 = "You aren't there for long. When he notices you, he stops talking and glares at you. _What do you want, scrubs? Go away._ What a jerk.";
	action = END_TALK;

//**Alvord**

begintalknode 2;
	state = -1;
	question = "Alvord";
	text1 = "This soldier is listening to another one talk. After listening for a few seconds, you learn that his name is Alvord.";
	text2 = "He is listening to the other soldier intently, laughing when he thinks something's funny. He pays no attention to you at all.";
	action = END_TALK;

//**Grasmuck**

begintalknode 3;
	state = -1;
	question = "Grasmuck";
	text1 = "This soldier is standing here with two others, listening to one of them talk. Every once in a while, he chuckles at something that is said. You hear that his name is Grasmuck.";
	text2 = "He doesn't pay much attention to you. When you approach, he glances at you and nods in greeting. Then he reverts his attention back to the other soldiers.";
	action = END_TALK;

//**Thomas**

begintalknode 4;
	state = -1;
	question = "Thomas";
	text1 = "There is a short, chubby solder sitting here, making a mess of his food. When you approach him, he looks up at you. He tongue hangs out of his mouth slightly.";
	text2 = "_THOM! THOM! Urrr..._ What a strange person.";
	text3 = "He idly flicks some food at you. You leave him alone.";
	action = END_TALK;

//**Gerald**

begintalknode 5;
	state = -1;
	nextstate = 1;
	personality = 10;
	question = "Gerald";
	text1 = "Here sits a husky soldier with sparse, unkempt stubble. He seems to be forcefeeding the soldier next to him. The other soldier keeps spitting out whatever is put in his mouth. It's rather amusing.";
	text2 = "He loses composure and busts up laughing. When he stops, he looks up at you. _Hey. I'm Gerry. This is my brother Thom. We're twins. Can you tell?_ They don't look like twins.";
	action = INTRO;
	text5 = "Gerry is once again trying to force feed his brother. He's not having much luck.";

begintalknode 6;
	state = 1;
	question = "You guys don't look like twins.";
	text1 = "_Oh, we are. He's just a few minutes older._ You would never have guessed.";

begintalknode 7;
	state = 1;
	question = "Is there something wrong with Thom?";
	text1 = "_Oh no, he just acts retarded. He's pretty good at it, huh?_";

//**Kyle**

begintalknode 8;
	state = -1;
	nextstate = 2;
	personality = 11;
	question = "Kyle";
	text1 = "This tall, flabby soldier is sitting here, watching one soldier sitting across from him try to feed the other.";
	text2 = "You inquire his name. _Kyle,_ he says passively. He's obviously distracted by the show of events that's happening in front of him.";
	action = INTRO;
	text5 = "Kyle's still watching the two soldiers sitting across from him.";

begintalknode 9;
	state = 2;
	question = "What are you doing?";
	text1 = "He glances up at you with a blunt expression. _Watching Gerry try to feed Thom. It's very entertaining._ You look at the two other soldiers. You have to admit, it is sort of funny.";

//**Mrs. Anderson**

begintalknode 10;
	state = -1;
	nextstate = 3;
	question = "Mrs. Anderson";
	text1 = "This large, auburn haired woman looks at you irritably when you approach the counter.";
	text2 = "_You can refer to me as Mrs. Anderson. What do you need?_";

begintalknode 11;
	state = 3;
	question = "Can I get food here?";
	text1 = "She points to the gray haired woman sitting next to her. _I only deal with the soldiers. Talk to Mrs. Hamilton about that._";

//**Mrs. Hamilton**

begintalknode 12;
	state = -1;
	nextstate = 4;
	question = "Mrs. Hamilton";
	text1 = "This aging woman grimaces when you approach. _You may call me Mrs. Hamilton. What do you want?_";

begintalknode 13;
	state = 4;
	nextstate = 5;
	condition = get_flag(100,2) == 0;
	question = "I need some food.";
	text1 = "_Oh, do you now? Hmph! What would the soldiers do without us? Starve. But are they even grateful for our help? No! No 'Please' or 'Thank you'..._ She continues to rant.";
	action = SET_SDF 100 2 1;

begintalknode 14;
	state = 5;
	question = "Ahem...";
	text1 = "She glares at you for interrupting her, then looks like she's about to say something else. However, instead she simply gives you your food and doesn't grant you another word.";
	text2 = "You step away from the counter and look at what she gave you. It barely looks edible, but you choose not to say anything.";
	code = 
		reward_give(9);
		break;
	action = END_TALK;

begintalknode 15;
	state = 4;
	condition = get_flag(100,2) == 1;
	question = "May I please have some food?";
	text1 = "She wordlessly gives you some mystery meat. It looks grotesque.";
	code = 
		reward_give(9);
		break;
	action = END_TALK;

//**Mrs. Rivas**

begintalknode 16;
	state = -1;
	nextstate = 6;
	question = "Mrs. Rivas";
	text1 = "A squat, grouchy looking woman with huge glasses is prodding at some suspicious looking meat with a kitchen knife. She's wearing a name tag labeled 'Mrs. Rivas'.";

begintalknode 17;
	state = 6;
	question = "Excuse me...";
	text1 = "You get her attention. When she looks up at you, she frowns even more. _No, no. You don't belong in here. Stay out of the kitchen. If you need something, talk to Mrs. Hamilton or Mrs. Anderson._";
	text2 = "She chases you out of the kitchen, still bearing the kitchen knife. It's frightening. More so than many of the monsters you've faced.";
	code = 
		relocate_character(0,20,8);
		relocate_character(1,20,7);
		relocate_character(2,20,6);
		relocate_character(3,20,5);
		force_view_center(20,8);
		play_sound(59);
		flip_terrain(19,5);
		break;
	action = END_TALK;

//**Brian**

begintalknode 18;
	state = -1;
	nextstate = 7;
	personality = 12;
	question = "Brian";
	text1 = "This man is sitting at a desk, busily writing something. He looks up when you approach.";
	text2 = "_Hey there. I'm Brian._";
	action = INTRO;
	text5 = "Brian is sitting here, writing what appears to be a letter.";
	text6 = "_Oh, hello again._";

begintalknode 19;
	state = 7;
	nextstate = 8;
	question = "What are you writing?";
	text1 = "He glances down at the piece of paper that he's writing on. _I'm writing a letter to my love, Jennifer. She's worried about me being here, so I'm sending her a letter to let her know that everything's fine._";

begintalknode 20;
	state = 8;
	question = "Do you think it will make her feel better?";
	text1 = "He smiles. _No, I suppose not. She probably won't feel better until I'm safe at home._";

//**Molly**

begintalknode 21;
	state = -1;
	nextstate = 9;
	question = "Molly";
	text1 = "A beautiful young woman is sitting behind the table in this room. She's dressed in priest robes. She smiles at you when you enter the room. It makes you feel all warm and fuzzy inside.";
	text2 = "_Hi. I'm Molly. How can I help you?_";

begintalknode 22;
	state = 9;
	nextstate = 10;
	question = "What can you do?";
	text1 = "_Well, I'm the camp's designated healer, so if any of you need healing, I can give it to you for free._";

begintalknode 23;
	state = 10;
	question = "Healing would be good.";
	text1 = "_Sure,_ she says cheerfully.";
	text2 = "She closes her eyes for a moment and stretches out her hand toward you. In seconds, all of your wounds are healed, and you feel fully revitalized.";
	code = 
		play_sound(60);
		change_char_energy(1000,1000);
		change_char_health(1000,1000);
		break;

begintalknode 24;
	state = 10;
	question = "Can you teach any spells?";
	text1 = "_No, I'm sorry. I would teach you spells if I could, but I'm not qualified as a teacher._";

//**Jeff**

begintalknode 25;
	state = -1;
	nextstate = 11;
	personality = 13;
	question = "Jeff";
	text1 = "This is Jeff, one of the men you rescued from the cave. He certainly looks healthier and more confident now that he's safe at this war camp. He is now sitting among some of the other soldiers here.";
	text2 = "When he sees you, he smiles in greeting. _Hello again._";
	action = INTRO;
	text5 = "Jeff is eating with some of the other soldiers. He waves when he sees you.";

begintalknode 26;
	state = 11;
	question = "Hello, Jeff. You look better now.";
	text1 = "_Because of you. Thanks again for saving us back there. We both owe you our lives._";

begintalknode 27;
	state = 11;
	nextstate = 12;
	question = "How's Captain Baker?";
	text1 = "_I couldn't tell you for sure, but Molly says he'll live. With her in charge of him, I think he'll be just fine._";

begintalknode 28;
	state = 12;
	question = "Who's Molly?";
	text1 = "_Oh, right. Molly is the healer here. She's wonderful. You should see her if you're injured, or even just tired._";

//**Captain Baker**

begintalknode 29;
	state = -1;
	question = "Captain Baker";
	text1 = "Captain Baker's wounds have been properly dressed and he doesn't seem to be in any more pain. However, he's still unconscious, so you can't get anything out of him.";

//**Prison Guard**

begintalknode 30;
	state = -1;
	nextstate = 13;
	question = "Prison Guard";
	text1 = "The prison guard on duty seems to have nothing to do with his time. He is currently playing solitaire on his desk. He seems to have not even noticed you.";

begintalknode 31;
	state = 13;
	condition = get_flag(101,2) == 1 && get_flag(103,2) == 0;
	question = "Excuse me, can I speak to the prisoner?";
	text1 = "The guard looks up from his game and examines you for a moment. _Yeah, I've been ordered to let you talk to him._";
	text2 = "He hands you a key. _This goes to his cell. Be careful._";
	text3 = "The guard looks up from his game. _Yeah, you have the key. Go on in._";
	code = 
		if (get_flag(107,2) == 0) {
			change_spec_item(2,1);
			set_flag(107,2,1);
		}
		break;
	action = SET_TO_1 108 2;

//**Captain Terronez**

begintalknode 32;
	state = -1;
	nextstate = 14;
	personality = 14;
	question = "Captain Terronez";
	text1 = "Captain Terronez is sitting in his office, filling out paperwork. When you enter, he puts down his pen and stands to greet you.";
	text2 = "_Ah, hello. I'm glad you came. Thanks again for helping us take out those dragonites. We probably wouldn't have survived without you._";
	text3 = "He continues, _I'm sure there are some things you'd like to know about. Feel free to ask your questions now._";
	action = INTRO;
	text5 = "Captain Terronez is in his office doing paperwork. When you enter, he rises to greet you.";
	text6 = "_Is there anything else I can do for you?_";

begintalknode 33;
	state = 14;
	nextstate = 15;
	question = "What do you know about the dragon?";
	text1 = "He sighs. _Sadly, very little. It's actually not the dragon that's been doing most of the destroying, though we have seen it. It's mostly its army that is behind the destructive power._";

begintalknode 34;
	state = 15;
	nextstate = 16;
	question = "What do you know about its army?";
	text1 = "_Its army, at least as we know it, consists of many common cave lizards, as well as some that breathe fire. He also has some lizards that are significantly larger, and therefore more deadly. Oh, and some drakes, but we haven't seen too many._";
	text2 = "He takes a deep breath and exhales. _However, we've seen all of these things before. What we haven't seen in the past are the lizard-men. Dragonites, we've been calling them, because they look like they're human-dragon hybrids._";

begintalknode 35;
	state = 16;
	condition = get_flag(101,2) == 0;
	question = "Go on.";
	text1 = "_Well, we managed to capture one after that last battle. We've tried interrogating him, but it's a relatively peaceful valley, so we don't have much experience with that sort of thing. Therefore, we haven't had any luck with it._";
	text2 = "_That's where you come in. We need answers from him, but he won't talk to us._";
	text3 = "_Basically, what I need you to do is to force some answers out of him. Find out all you can about where they're coming from, what they're doing here, and why they're doing it. Then report back to me when you have some answers._";
	action = SET_SDF 101 2 1;

begintalknode 36;
	state = 14;
	condition = get_flag(103,2) == 1 && get_flag(104,2) == 0;
	question = "(Explain what the prisoner told you.)";
	text1 = "You describe to Captain Terronez what you learned from interrogating the dragonite. He listens intently until you finish.";
	text2 = "_An encampment? And he said it was to the northwest? Hmm... that is news._ He thinks for a moment. _Alright then, I have another request of you._";
	action = SET_SDF 104 2 1;

begintalknode 37;
	state = 14;
	nextstate = 17;
	condition = get_flag(102,2) == 0 && get_flag(104,2) == 1;
	question = "What do you need now?";
	text1 = "_I'll keep it simple. I want you to raid that encampment and get rid of that shaman. From what you said, the camp sounded relatively small, so it shouldn't be too difficult._";
	text2 = "_I would send soldiers to deal with it, but I'm afraid that's not possible. I need every one of them here. The attacks are frequent, and we need to stay here to protect the bridge. So what do you say? Can you do it?_";

begintalknode 38;
	state = 17;
	question = "Yes.";
	text1 = "_Good. Get it done as fast as you can, then report back to me._";
	action = END_TALK;
	code = 
		set_flag(102,2,1);
		toggle_quest(2,1);
		break;

begintalknode 39;
	state = 17;
	question = "No, I don't think so.";
	text1 = "The captain is visibly disappointed. _I see. Well, make sure to let me know if you change your mind._";
	action = END_TALK;

begintalknode 40;
	state = 14;
	condition = get_flag(102,2) == 1 && get_flag(200,1) == 1 && get_flag(109,2) == 0;
	question = "The shaman is dead.";
	text1 = "_Oh, good. I knew you could take care of it. Now, I have some valuable information for you._";
	text2 = "_I dispatched some scouts while you were gone. They reported that they found the entrance to the dragon's cave to the north. Search the mountain side carefully and you should be able to find it._";
	text3 = "_Listen, though. This is important. There were human tracks leading into the cave. It could be a party that was lost, presumed dead, a couple of weeks ago. If you encounter any survivors, please help them._";
	action = SET_SDF 109 2 1;
	code =
		toggle_quest(2,0);
		break;

begintalknode 41;
	state = 14;
	condition = get_flag(200,5) == 1;
	question = "The dragon is dead!";
	text1 = "Terronez looks at you, slight surprise mirrored on his face. _Is he now? Well... uh... good! Well done. Go ahead and report to the Poulan council. They'll probably reward you somehow._";
	text2 = "_Unfortunately, the problem isn't quite over yet. There still might be dragonites wandering around. Even if they are weakened by their lord's destruction, we still need troops watching for them._";
	text3 = "_However, we can handle that. Your work here seems to be done. Thank you for all you've done for us._";

//**Bigga**

begintalknode 42;
	state = -1;
	nextstate = 18;
	question = "Bigga";
	text1 = "There is a miserable looking dragonite in this holding cell. He glares at you when you appear to him.";
	text2 = "_More interrogators,_ he mutters distastefully. _I am Bigga, of the dragon blooded. Go away. I have nothing to tell you._ Oddly, there's no trace of the reptilian sibilance in his voice.";

begintalknode 43;
	state = 18;
	nextstate = 19;
	question = "I need to ask you some questions.";
	text1 = "He emits a low growl. _Are you dense? I will not answer your questions._";

begintalknode 44;
	state = 19;
	nextstate = 20;
	question = "You will, or you will be forced to.";
	text1 = "He gives you a spiteful, toothy grin. _Force me then. I am at your mercy._";
	text2 = "He waits, daring you to follow through on your threat.";
	code = 
		w = 0;
		if (get_spell_level(w,0,11) > 0)//capture mind
			set_flag(105,2,1);
		if (get_spell_level(w,1,3) > 0)//terror
			set_flag(106,2,1);
		x = 1;
		if (get_spell_level(x,0,11) > 0)//capture mind
			set_flag(105,2,1);
		if (get_spell_level(x,1,3) > 0)//terror
			set_flag(106,2,1);
		y = 2;
		if (get_spell_level(y,0,11) > 0)//capture mind
			set_flag(105,2,1);
		if (get_spell_level(y,1,3) > 0)//terror
			set_flag(106,2,1);
		z = 3;
		if (get_spell_level(z,0,11) > 0)//capture mind
			set_flag(105,2,1);
		if (get_spell_level(z,1,3) > 0)//terror
			set_flag(106,2,1);
		break;

begintalknode 45;
	state = 20;
	nextstate = 21;
	condition = get_flag(105,2) == 1;
	question = "(Cast Capture Mind on him.)";
	text1 = "In his weakened state, the spell easily takes hold. His face and voice become emotionless.";
	text2 = "_I am at your service, Master._";
	code = 
		j = char_with_highest_skill(11);
		play_sound(90);
		change_char_energy(j,-13);
		break;

begintalknode 46;
	state = 21;
	nextstate = 22;
	question = "Where are you and your kind coming from?";
	text1 = "He responds without hesitation. _We were created by the dragon Gavin. His cave is to the north._";

begintalknode 47;
	state = 22;
	nextstate = 23;
	question = "What are you doing here?";
	text1 = "Again, the response is immediate. _We are serving Gavin's wishes to attack the humans. Our purpose is to raid human settlements while a shaman performs rituals in the northwestern encampment to strengthen Gavin's power._";

begintalknode 48;
	state = 23;
	nextstate = 24;
	question = "Why? What is Gavin's purpose?";
	text1 = "_Gavin seeks revenge upon humankind and its allies for what was done to the dragon race._";
	text2 = "So that's it then. Revenge. The Empire caused more trouble than they foresaw by purging the surface of magical creatures.";
	text3 = "But wait... that was years ago. Where has this Gavin been for all this time?";

begintalknode 49;
	state = 24;
	question = "Where has Gavin been since the dragons were purged?";
	text1 = "The spell is starting to wear off. Bigga is trying to stifle his answers.";
	text2 = "_He has been... in... hibernation... for years... since..._";
	text3 = "Bigga is finally successful in breaking through the spell. However, it's too late. The answers have been given. In shame, he thrusts his claws into his stomach and rips out his insides. He dies instantly.";
	action = END_TALK;
	code = 
		play_sound(86);
		kill_char(25,2,0);
		set_flag(103,2,1);
		break;

begintalknode 50;
	state = 20;
	nextstate = 25;
	condition = get_flag(106,2) == 1;
	question = "(Cast Terror on him.)";
	text1 = "In his weakened state, the spell easily takes hold. He drops to a crouch in the corner and starts screaming in fear.";
	text2 = "_No! Get away!_";
	code = 
		j = char_with_highest_skill(12);
		play_sound(90);
		change_char_energy(j,-6);
		break;

begintalknode 51;
	state = 25;
	nextstate = 26;
	question = "Where are you and your kind coming from?";
	text1 = "He screams his response, desperate for the terror to subside. _G-Gavin! The dragon Gavin made us! North! Northern cave!_";

begintalknode 52;
	state = 26;
	nextstate = 27;
	question = "What are you doing here?";
	text1 = "He stammers uncontrollably. _Attacking humans! Raid settlements... sh-shaman... performing rituals to s-strengthen Gavin... northwestern encampment! Please! No more!_ He squeezes himself into the corner.";

begintalknode 53;
	state = 27;
	nextstate = 28;
	question = "Why? What is Gavin's purpose?";
	text1 = "He tries in vain to hide himself under the sleeping mat. _Revenge... f-for what happened to the... d-dragons._";
	text2 = "So that's it then. Revenge. The Empire caused more trouble than they foresaw by purging the surface of magical creatures.";
	text3 = "But wait... that was years ago. Where has this Gavin been for all this time?";

begintalknode 54;
	state = 28;
	question = "Where has Gavin been since the dragons were purged?";
	text1 = "_H-hibernation._ He buries his face in his hands. He seems to be crying.";
	text2 = "You leave him alone for a moment to sort through the things that he's said.";
	text3 = "By the time you turn your attention back to him, he has come to his senses. However, it's too late. The answers have been given. In shame, he thrusts his claws into his stomach and rips out his insides. He dies instantly.";
	action = END_TALK;
	code = 
		play_sound(86);
		kill_char(25,2,0);
		set_flag(103,2,1);
		break;

begintalknode 55;
	state = 20;
	nextstate = 29;
	question = "(Flog him.)";
	text1 = "You start kicking and hitting him mercilessly.";
	text2 = "_Arrgh! Bastards!_ he screams in pain.";
	code = 
		play_sound(72);
		break;

begintalknode 56;
	state = 29;
	nextstate = 30;
	question = "Where are you and your kind coming from?";
	text1 = "You stop flogging and wait for his answer.";
	text2 = "He glares up at you. _I will tell you nothing,_ he hisses.";
	text3 = "You begin flogging him again. Finally, he gives in. _Gavin! The dragon Gavin! Up in... cave to the north... arrggh!_";
	code = 
		play_sound(118);
		break;

begintalknode 57;
	state = 30;
	nextstate = 31;
	question = "What are you doing here?";
	text1 = "You stop again to let him answer.";
	text2 = "His resolve seems to have weakened significantly. _Ugh... we're... attacking the humans... while a shaman performs rituals... strengthens Gavin... northwest... camp..._";
	code = 
		play_sound(72);
		break;

begintalknode 58;
	state = 31;
	nextstate = 32;
	question = "Why? What is Gavin's purpose?";
	text1 = "He props himself against the wall, exhausted and stricken. _To avenge... brethren..._";
	text2 = "So that's it then. Revenge. The Empire caused more trouble than they foresaw by purging the surface of magical creatures.";
	text3 = "But wait... that was years ago. Where has this Gavin been for all this time?";
	code = 
		play_sound(118);
		break;

begintalknode 59;
	state = 32;
	question = "Where has Gavin been since the dragons were purged?";
	text1 = "He glares at you and doesn't respond. You begin flogging him again.";
	text2 = "_Ugh... hibernating... Gavin... hibernating..._";
	text3 = "You stop beating him and think about the things that he's said. Then you look back down at his broken, bloodied form. You notice that he's not breathing. Apparently, the flogging was too much for him.";
	action = END_TALK;
	code = 
		play_sound(157);
		kill_char(25,2,0);
		set_flag(103,2,1);
		break;